package com.fling.tutorial;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.graphics.g2d.NinePatch;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.fling.Locator;
import com.fling.observer.Event;
import com.fling.observer.Subject;

public class ThirdFlingState extends TutorialState{

	public ThirdFlingState(TutorialManager t, Subject subject){
		super(t, subject);
	}
	
	@Override
	public void update(float delta) {
		
	}

	@Override
	public void registerInput(INPUT input) {
		switch(input){
		case JUMP_RIGHT:
		case JUMP_LEFT:
			exit();
			break;
		default:
			break;
		}
	}

	@Override
	public void enter() {
		
	}

	@Override
	public void exit() {			
		subject.notify(null, Event.EVENT_TUTORIAL_COMPLETED);
		Locator.setOverallGameSpeed(1);
		tutorial.changeState(new LastState(tutorial,subject));
	}

	@Override
	public void render(SpriteBatch sb, NinePatch patch, BitmapFont font) {
	    patch.draw(sb, Gdx.graphics.getWidth() * 0.35f, Gdx.graphics.getHeight() * 0.2f, Gdx.graphics.getWidth() * 0.55f, Gdx.graphics.getHeight() * 0.15f);
        font.drawWrapped(sb, "Great!\nFling horizontally again", Gdx.graphics.getWidth() * 0.37f, Gdx.graphics.getHeight() * 0.31f,Gdx.graphics.getHeight() * 0.32f);
		
	}

}
